package cn.tedu._05weibo.pojo.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Pattern;

@Data
public class UserRegDTO {
    /*
        1.NotNull: 校验对象不能为null;
        2.NotEmpty: 校验对象不能为null和空字符串;
        3.NotBlank: 校验对象不能为null、空字符串和空白串;
        4.Size: 字符串类型长度校验;
        5.Range: 数值类型范围校验;
     */
    //@NotNull(message = "用户名不能为null")
    //@NotEmpty(message = "用户名不能为null和空字符串")
    //@NotBlank(message = "用户名不能为null、空字符串和空白串")
    //@Size(min = 6, max = 12, message = "用户名必须在6-12位之间")
    @Pattern(regexp = "^[\\u4e00-\\u9fa5]{0,7}|^[a-zA-Z]{0,14}$", message = "用户名最长14个英文或者7个汉字")
    @ApiModelProperty(value = "用户名", required = true, example = "Tony")
    private String username;
    @ApiModelProperty(value = "密码", required = true)
    private String password;
    @ApiModelProperty(value = "昵称", required = true)
    private String nickname;
}
